package vip.specimen.system.datasource.validation;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Future;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * *@Author: 余浪人
 * *@Date：2021/03/07 15:23
 * *@Email:yulangren520@Gmail.com
 * *@QQ:1368419640
 **/
@Getter
@Setter
public class SystemAdvertisingValidation {
    @NotBlank(message = "广告名称不可为空")
    @Length(max = 128, message = "广告名称过长")
    private String advertisingName;

    @NotNull(message = "请输入合法的到期时间")
    @Future(message = "到期时间必须是一个未来的时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    @Length(max = 2147483647, message = "广告内容过长")
    private String advertisingContent;
}
